﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:behaviors="clr-namespace:Rio.Manager.Application.Behaviors"
             xmlns:mvvmLightCommand="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:Rio_Framework_Pages_Controls="clr-namespace:Rio.Framework.Pages.Controls;assembly=Rio.Framework.Pages"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
             xmlns:System="clr-namespace:System;assembly=mscorlib"
             x:Class="Rio.Manager.Application.Views.NewWorkflowTabView"
             mc:Ignorable="d"
             d:DesignHeight="1000"
             d:DesignWidth="1024">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Rio.Manager.Application;component/Skins/NewWorkflowTabSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Style x:Key="BorderStyle1"
                   TargetType="Border">
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect BlurRadius="10" />
                    </Setter.Value>
                </Setter>
                <Setter Property="Background"
                        Value="#4CF9F9F9" />
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>

    <UserControl.DataContext>
        <Binding Path="NewWorkflowTab"
                 Source="{StaticResource Locator}" />
    </UserControl.DataContext>

    <Grid x:Name="LayoutRoot">

        <i:Interaction.Triggers>
            <i:EventTrigger EventName="Loaded">
                <mvvmLightCommand:EventToCommand Command="{Binding InitializationCommand}" />
            </i:EventTrigger>
        </i:Interaction.Triggers>
        <Border HorizontalAlignment="Center"
                Padding="15,20,0,5"
                MinWidth="800"
                VerticalAlignment="Top"
                BorderBrush="Black"
                Style="{StaticResource BorderStyle1}"
                Background="#FFF9F9F9">

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Rio_Framework_Pages_Controls:BindableOrganizationFolderTypePanel Mode="Admin"
                                                                                  Margin="0,0,0,10"
                                                                                  HorizontalAlignment="Left"
                                                                                  SelectedOrganization="{Binding SelectedOrganization, Mode=TwoWay}"
                                                                                  SelectedFolderType="{Binding SelectedFolderType, Mode=TwoWay}"
                                                                                  IsEnabled="{Binding IsEditMode, Converter={StaticResource NotOperatorValueConverter}, Mode=TwoWay}"
                                                                                  Visibility="{Binding IsChildCreation, ConverterParameter=not, Converter={StaticResource CustomBooleanToVisibilityConverter}, Mode=TwoWay}" />
                <StackPanel Orientation="Vertical"
                            Grid.Row="1"
                            d:LayoutOverrides="Height"
                            Margin="0,10,0,0">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5"
                          Visibility="{Binding IsChildCreation, ConverterParameter=not, Converter={StaticResource CustomBooleanToVisibilityConverter}, Mode=TwoWay}" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding WorkflowTypesText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />
                </StackPanel>
                <StackPanel Grid.Row="2"
                            Orientation="Horizontal"
                            Margin="40,10,0,10"
                            HorizontalAlignment="Left">
                    <telerik:RadComboBox Width="500"
                                         Height="25"
                                         Name="WorkflowModelComboBox"
                                         ItemsSource="{Binding WorkflowModels, Mode=TwoWay}"
                                         SelectedItem="{Binding SelectedWorkflowModel, Mode=TwoWay, NotifyOnValidationError=False}"
                                         ItemTemplate="{StaticResource WorkflowModelDataTemplate}"
                                         SelectionBoxTemplate="{StaticResource SelectedWorkflowModelDataTemplate}"
                                         IsEnabled="{Binding IsEditMode, Converter={StaticResource NotOperatorValueConverter}, Mode=TwoWay}"/>
                </StackPanel>
                <StackPanel Orientation="Vertical"
                            Grid.Row="3"
                            d:LayoutOverrides="Height"
                            Margin="0,10,0,0">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding WorkflowLabelText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />
                </StackPanel>
                <TextBox Grid.Row="4"
                         TextWrapping="Wrap"
                         Text="{Binding CurrentWorkflowDefinition.Name, Mode=TwoWay, NotifyOnValidationError=False}"
                         Width="500"
                         HorizontalAlignment="Left"
                         Margin="40,10,0,10" />
                <StackPanel Orientation="Vertical"
                            Grid.Row="5"
                            d:LayoutOverrides="Height"
                            Margin="0,10,0,0">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding WorkflowDescriptionText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />
                </StackPanel>
                <TextBox Grid.Row="6"
                         TextWrapping="Wrap"
                         Text="{Binding CurrentWorkflowDefinition.Description, Mode=TwoWay}"
                         Width="500"
                         HorizontalAlignment="Left"
                         Margin="40,10,0,10" />
                <!--<StackPanel Orientation="Vertical"
                            Grid.Row="7"
                            d:LayoutOverrides="Height"
                            Margin="0,10,0,0">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding WorkflowTypeText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />
                    
                    <Grid Width="350" HorizontalAlignment="Left" Margin="40,10,0,10">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        
                        <RadioButton Grid.Row="0" 
                                     Grid.Column="0"
                                     x:Name="radioButtonClassicalType"
                                     VerticalAlignment="Center"
                                     GroupName="TypeGroup"
                                     IsChecked="{Binding CurrentWorkflowDefinition.IsHierarchical, Converter={StaticResource NotOperatorValueConverter}, Mode=TwoWay, NotifyOnValidationError=False}"
                                     HorizontalAlignment="Left"
                                     Content="{Binding WorkflowClassicalText, Mode=TwoWay}" />
                        
                        <RadioButton Grid.Row="0"
                                     Grid.Column="1" 
                                     x:Name="radioButtonHierarchicalType"
                                     VerticalAlignment="Center"
                                     GroupName="TypeGroup"

                                     IsChecked="{Binding CurrentWorkflowDefinition.IsHierarchical, Mode=TwoWay, NotifyOnValidationError=False}"
                                     HorizontalAlignment="Left"
                                     Content="{Binding WorkflowHierarchicalText, Mode=TwoWay}" />

                    </Grid>
                </StackPanel>-->
                
                <StackPanel Orientation="Vertical"
                            Grid.Row="8"
                            Margin="0,10,0,0"
                            d:LayoutOverrides="Height">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <Grid Margin="5,10,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBlock TextWrapping="Wrap"
                                   Text="{Binding WorkflowStartDateText, Mode=TwoWay}"
                                   FontWeight="Bold" />
                        <TextBlock TextWrapping="Wrap"
                                   Text="{Binding WorkflowEndDateText, Mode=TwoWay}"
                                   Grid.Column="1"
                                   FontWeight="Bold" />
                        <telerik:RadDatePicker d:LayoutOverrides="Height"
                                               Grid.Row="1"
                                               Margin="40,5,0,0"
                                               Width="100"
                                               HorizontalAlignment="Left"
                                               DateTimeWatermarkContent=""
                                               SelectedValue="{Binding CurrentWorkflowDefinition.StartDate, Mode=TwoWay}" />
                        <StackPanel Grid.Column="1"
                                    Orientation="Horizontal"
                                    Grid.Row="1"
                                    d:LayoutOverrides="Height"
                                    Margin="40,5,0,0">
                            <telerik:RadDatePicker x:Name="radDatePicker"
                                                   Width="100"
                                                   IsEnabled="{Binding IsChecked, ElementName=checkBox, Mode=TwoWay}"
                                                   SelectedValue="{Binding CurrentWorkflowDefinition.EndDate, Mode=TwoWay}" />
                            <CheckBox x:Name="checkBox"
                                      Content="{Binding ActivateEndDateText, Mode=TwoWay}"
                                      VerticalAlignment="Center"
                                      Margin="10,0,0,0"
                                      IsChecked="{Binding CurrentWorkflowDefinition.EndDate, Converter={StaticResource NullToEnabledConverter}, Mode=OneWay}">
                                <i:Interaction.Triggers>
                                    <i:EventTrigger EventName="Unchecked">
                                        <mvvmLightCommand:EventToCommand Command="{Binding SetToNullEndDateCommand, Mode=TwoWay}" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>
                            </CheckBox>
                        </StackPanel>
                    </Grid>
                </StackPanel>
                <StackPanel Orientation="Vertical"
                            Grid.Row="9"
                            Margin="0,10,0,0">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding TriggersText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />
                </StackPanel>
                <telerik:RadGridView Name="ConditionsRadGridView"
                                     Grid.Row="10"
                                     BorderThickness="0"
                                     ShowColumnHeaders="False"
                                     ShowGroupPanel="False"
                                     Background="{x:Null}"
                                     AlternateRowBackground="{x:Null}"
                                     GridLinesVisibility="None"
                                     AutoGenerateColumns="False"
                                     Margin="40,10,10,10"
                                     SelectionMode="Multiple"
                                     RowIndicatorVisibility="Collapsed"
                                     BorderBrush="{x:Null}"
                                     ItemsSource="{Binding WorkflowActions, Mode=TwoWay, NotifyOnValidationError=False}"
                                     RowStyle="{StaticResource ActionsConditionsGridViewRowStyle}"
                                     SelectionChanged="ConditionsRadGridView_SelectionChanged">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewSelectColumn />
                        <telerik:GridViewDataColumn IsReadOnly="True"
                                                    DataMemberBinding="{Binding Description, Mode=TwoWay}" />
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>
                <StackPanel Orientation="Vertical"
                            Grid.Row="11"
                            d:LayoutOverrides="Height"
                            Margin="0,10,0,0">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding WorkflowReceiversText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />
                </StackPanel>
                <Grid Grid.Row="12"
                      Margin="40,10,0,10"
                      HorizontalAlignment="Left">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <RadioButton x:Name="radioButton"
                                 VerticalAlignment="Center"
                                 GroupName="RecipientsGroup"
                                 IsChecked="{Binding CurrentWorkflowDefinition.ReceiversType, Converter={StaticResource ReceiverTypeToBooleanConverter}, Mode=TwoWay, NotifyOnValidationError=False}"
                                 Width="400"
                                 HorizontalAlignment="Left"
                                 Content="{Binding AutomaticReceiversText, Mode=TwoWay}" />
                    <RadioButton x:Name="radioButton1"
                                 Content="{Binding IndexationReceiversText, Mode=TwoWay}"
                                 Grid.Row="1"
                                 VerticalAlignment="Center"
                                 GroupName="RecipientsGroup"
                                 Width="400"
                                 HorizontalAlignment="Left"
                                 Visibility="{Binding IsChildCreation, ConverterParameter=not, Converter={StaticResource CustomBooleanToVisibilityConverter}, Mode=TwoWay}"
                                 IsChecked="{Binding IsChecked, Converter={StaticResource NotOperatorValueConverter}, ElementName=radioButton}" />
                    <telerik:RadButton x:Name="radButton"
                                       Content="{Binding DefineText, Mode=TwoWay}"
                                       Grid.Column="1"
                                       HorizontalAlignment="Left"
                                       VerticalAlignment="Center"
                                       Width="130"
                                       Height="25"
                                       Margin="10,0,0,0"
                                       Command="{Binding OpenGroupsWindowCommand}" />
                    <telerik:RadButton x:Name="radButton1"
                                       Content="{Binding DefineText, Mode=TwoWay}"
                                       Grid.Column="1"
                                       Grid.Row="1"
                                       HorizontalAlignment="Left"
                                       VerticalAlignment="Center"
                                       Width="130"
                                       Height="25"
                                       Margin="10,5,0,5"
                                       Visibility="{Binding IsChildCreation, ConverterParameter=not, Converter={StaticResource CustomBooleanToVisibilityConverter}, Mode=TwoWay}"
                                       Command="{Binding OpenReceiversIndexWindowCommand}"
                                       IsEnabled="{Binding IsChecked, ElementName=radioButton1}" />
                </Grid>
                <StackPanel Orientation="Vertical"
                            Grid.Row="13"
                            Margin="0,10,0,0">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding TreatmentsText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />
                </StackPanel>
                <telerik:RadGridView Name="ActionsRadGridView"
                                     Grid.Row="14"
                                     BorderThickness="0"
                                     ShowColumnHeaders="False"
                                     ShowGroupPanel="False"
                                     Background="{x:Null}"
                                     AlternateRowBackground="{x:Null}"
                                     GridLinesVisibility="None"
                                     AutoGenerateColumns="False"
                                     Margin="40,10,10,10"
                                     SelectionMode="Multiple"
                                     ItemsSource="{Binding SelectedWorkflowModel.Actions, Mode=OneWay}"
                                     RowIndicatorVisibility="Collapsed"
                                     BorderBrush="{x:Null}"
                                     RowStyle="{StaticResource ActionsConditionsGridViewRowStyle}"
                                     SelectionChanged="ActionsRadGridView_SelectionChanged">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewSelectColumn />
                        <telerik:GridViewDataColumn IsReadOnly="True"
                                                    DataMemberBinding="{Binding Description, Mode=TwoWay}" />
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>

                <StackPanel Orientation="Vertical"
                            Grid.Row="15"
                            Margin="0,10,0,0">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding ManagementRulesText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />

                    <telerik:RadButton x:Name="radButtonRules"
                                       Content="{Binding EditManagementRulesText, Mode=TwoWay}"
                                       Margin="0,0,10,0"
                                       Width="200"
                                       Height="30"
                                       Command="{Binding OpenWorkflowRulesEditorWindowCommand}"
                                       Visibility="Visible">
                        <telerik:RadButton.Background>
                            <LinearGradientBrush EndPoint="0.5,1"
                                                 StartPoint="0.5,0">
                                <GradientStop Color="White"
                                              Offset="0" />
                                <GradientStop Color="Gainsboro"
                                              Offset="0.5" />
                                <GradientStop Color="#FFADADAD"
                                              Offset="0.5" />
                                <GradientStop Color="#FFAFC3D6"
                                              Offset="1" />
                            </LinearGradientBrush>
                        </telerik:RadButton.Background>
                    </telerik:RadButton>
                </StackPanel>

                <!--<StackPanel Orientation="Vertical"
                            Grid.Row="16"
                            d:LayoutOverrides="Height"
                            Margin="0,10,0,0"
                            Visibility="{Binding IsChildCreation, ConverterParameter=not, Converter={StaticResource CustomBooleanToVisibilityConverter}, Mode=TwoWay}">
                    <Path Data="M62,141 L185.19902,141"
                          Fill="Black"
                          Stretch="Fill"
                          Stroke="Black"
                          UseLayoutRounding="False"
                          Margin="50,0"
                          StrokeThickness="0.5" />
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding WorkflowLinksText, Mode=TwoWay}"
                               FontWeight="Bold"
                               Height="16"
                               d:LayoutOverrides="VerticalAlignment"
                               Margin="5,10,0,0" />
                </StackPanel>

                <telerik:RadGridView Grid.Row="17"
                                     Margin="40,0,10,10"
                                     AutoGenerateColumns="False"
                                     CanUserDeleteRows="False"
                                     CanUserFreezeColumns="False"
                                     CanUserInsertRows="False"
                                     CanUserReorderColumns="False"
                                     ShowGroupPanel="False"
                                     ItemsSource="{Binding WorkflowSourceForEdition.Childs, Mode=TwoWay}"
                                     Visibility="{Binding IsChildCreation, ConverterParameter=not, Converter={StaticResource CustomBooleanToVisibilityConverter}, Mode=TwoWay}">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn Header="{Binding NewWorkflowTab.WorkflowLinks_Name, Mode=TwoWay, Source={StaticResource Locator}}"
                                                    DataMemberBinding="{Binding Name, Mode=TwoWay}"
                                                    IsReadOnly="True" />
                        <telerik:GridViewDataColumn Header="{Binding NewWorkflowTab.WorkflowLinks_Description, Mode=TwoWay, Source={StaticResource Locator}}"
                                                    DataMemberBinding="{Binding Description, Mode=TwoWay}"
                                                    IsReadOnly="True" />
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>-->
                <telerik:ItemsControl Margin="20"
                                      Grid.Row="18"
                                      ItemsSource="{Binding Errors, Mode=TwoWay}"
                                      ItemTemplate="{StaticResource BindableValidationSummaryDataTemplate}"
                                      Style="{StaticResource BindableValidationSummaryStyle}"
                                      Background="White"
                                      BorderBrush="Red"
                                      BorderThickness="1"
                                      Visibility="{Binding HasErrors, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" />
                <StackPanel Orientation="Vertical"
                            Grid.Row="19"
                            Margin="0,10,0,0"
                            HorizontalAlignment="Center">
                    <StackPanel Orientation="Horizontal"
                                VerticalAlignment="Center"
                                Margin="0,10"
                                HorizontalAlignment="Center">
                        <telerik:RadButton x:Name="radButton2"
                                           Content="{Binding SaveModificationsText, Mode=TwoWay}"
                                           Margin="0,0,10,0"
                                           Width="200"
                                           Height="30"
                                           Visibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay}">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <mvvmLightCommand:EventToCommand Command="{Binding SaveModifiedWorkflowDefinitionCommand}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                            <telerik:RadButton.Background>
                                <LinearGradientBrush EndPoint="0.5,1"
                                                     StartPoint="0.5,0">
                                    <GradientStop Color="White"
                                                  Offset="0" />
                                    <GradientStop Color="Gainsboro"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFADADAD"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFAFC3D6"
                                                  Offset="1" />
                                </LinearGradientBrush>
                            </telerik:RadButton.Background>
                        </telerik:RadButton>
                        <telerik:RadButton Content="{Binding SaveText, Mode=TwoWay}"
                                           Margin="0,0,10,0"
                                           Width="200"
                                           Height="30"
                                           Visibility="{Binding Visibility, Converter={StaticResource NotOperatorValueConverter}, ElementName=radButton2, Mode=TwoWay}">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <mvvmLightCommand:EventToCommand Command="{Binding SaveWorkflowDefinitionCommand}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                            <telerik:RadButton.Background>
                                <LinearGradientBrush EndPoint="0.5,1"
                                                     StartPoint="0.5,0">
                                    <GradientStop Color="White"
                                                  Offset="0" />
                                    <GradientStop Color="Gainsboro"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFADADAD"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFAFC3D6"
                                                  Offset="1" />
                                </LinearGradientBrush>
                            </telerik:RadButton.Background>
                        </telerik:RadButton>
                        <telerik:RadButton Content="{Binding SaveAsModelText, Mode=TwoWay}"
                                           Margin="10,0"
                                           Width="200"
                                           Height="30"
                                           Visibility="{Binding IsChildCreation, ConverterParameter=not, Converter={StaticResource CustomBooleanToVisibilityConverter}, Mode=TwoWay}">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <mvvmLightCommand:EventToCommand Command="{Binding SaveWorkflowAsModelCommand}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                            <telerik:RadButton.Background>
                                <LinearGradientBrush EndPoint="0.5,1"
                                                     StartPoint="0.5,0">
                                    <GradientStop Color="White"
                                                  Offset="0" />
                                    <GradientStop Color="Gainsboro"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFADADAD"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFAFC3D6"
                                                  Offset="1" />
                                </LinearGradientBrush>
                            </telerik:RadButton.Background>
                        </telerik:RadButton>
                        <telerik:RadButton Content="{Binding ClearFormText, Mode=TwoWay}"
                                           Margin="10,0"
                                           Width="200"
                                           Height="30">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <mvvmLightCommand:EventToCommand Command="{Binding ClearDataFormCommand}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                            <telerik:RadButton.Background>
                                <LinearGradientBrush EndPoint="0.5,1"
                                                     StartPoint="0.5,0">
                                    <GradientStop Color="White"
                                                  Offset="0" />
                                    <GradientStop Color="Gainsboro"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFADADAD"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFD9DAA9"
                                                  Offset="1" />
                                </LinearGradientBrush>
                            </telerik:RadButton.Background>
                        </telerik:RadButton>
                        <telerik:RadButton Content="{Binding DeleteText, Mode=TwoWay}"
                                           Margin="10,0"
                                           Width="200"
                                           Height="30"
                                           IsEnabled="{Binding IsEditMode, Mode=TwoWay}">
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="Click">
                                    <mvvmLightCommand:EventToCommand Command="{Binding DeactivateWorkFlowDefinitionCommand}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                            <telerik:RadButton.Background>
                                <LinearGradientBrush EndPoint="0.5,1"
                                                     StartPoint="0.5,0">
                                    <GradientStop Color="White"
                                                  Offset="0" />
                                    <GradientStop Color="Gainsboro"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFADADAD"
                                                  Offset="0.5" />
                                    <GradientStop Color="#FFC89F9F"
                                                  Offset="1" />
                                </LinearGradientBrush>
                            </telerik:RadButton.Background>
                        </telerik:RadButton>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
        <telerik:RadBusyIndicator BusyContent=""
                                  IsBusy="{Binding BusyIndicator.IsBusy, Mode=OneWay}"
                                  d:IsHidden="True" />
    </Grid>
</UserControl>